/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.workforce.common.tags;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;

/**
 *
 * @author neo
 */
public class FieldButtonTag extends FieldBaseTag {

    @Override
    public int doStartTag() throws JspException {
        JspWriter out = pageContext.getOut();
        StringBuffer s = new StringBuffer();
        s.append("<input type=\"button\" id=\"").append(sid).append("\" name=\"").append(id).append("\"");
        s.append(" value=\"").append(label).append("\"");
        if (style != null) {
            s.append(" style=\"").append(style).append("\"");
        }
        if (sClass != null) {
            s.append(" class=\"").append(sClass).append("\"");
        }
        if (onclick != null) {
            s.append(" onClick=\"").append(onclick).append("\"");
        }
        s.append(">");
        try {
            out.print(s.toString());
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return SKIP_BODY;
    }

    @Override
    public int doEndTag() throws JspException {
        return super.doEndTag();
    }
}
